/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 全局样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Icons", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: #f5f5f7;
    color: #1d1d1f;
    line-height: 1.6;
    min-height: 100vh;
}

/* 顶部标题区域 */
header {
    text-align: center;
    padding: 3rem 1rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

h1 {
    font-size: 2.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #1d1d1f 0%, #434344 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.1rem;
    color: #86868b;
    font-weight: 400;
}

/* 主要内容区域 */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* 上传区域样式 */
.upload-area {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.upload-box {
    border: 2px dashed rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-box:hover {
    border-color: #0071e3;
    background: rgba(0, 113, 227, 0.05);
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}

.upload-box:hover .upload-icon {
    transform: scale(1.1);
}

.upload-tip {
    color: #86868b;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* 预览区域样式 */
.preview-area {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.preview-area h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-weight: 600;
    color: #1d1d1f;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.preview-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.preview-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.preview-box {
    width: 100%;
    height: 128px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f7;
    border-radius: 8px;
    overflow: hidden;
}

.preview-box img {
    display: block;
    max-width: 100%;
    height: auto;
}

.preview-item p {
    margin: 8px 0;
    color: #1d1d1f;
    font-size: 14px;
    font-weight: 500;
}

/* 设置不同尺寸的预览框 */
#preview16 { width: 64px; height: 64px; }
#preview32 { width: 96px; height: 96px; }
#preview48 { width: 128px; height: 128px; }
#preview128 { width: 192px; height: 192px; }

/* 下载按钮样式 */
.download-single-btn {
    background: #0071e3;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.download-single-btn:hover {
    background: #0077ED;
    transform: scale(1.05);
}

.download-single-btn svg {
    transition: transform 0.3s ease;
}

.download-single-btn:hover svg {
    transform: translateY(2px);
}

.reset-btn {
    background: rgba(0, 0, 0, 0.05);
    color: #1d1d1f;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 20px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 2rem;
    display: block;
    margin: 0 auto;
}

.reset-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* 响应式适配 */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    main {
        padding: 0 1rem;
    }
    
    .preview-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .preview-item {
        padding: 1rem;
    }
}

/* 添加动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.preview-area {
    animation: fadeIn 0.5s ease-out;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.loading:after {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid #666;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 修改复选框样式 */
.checkbox-container {
    display: inline-block;
    position: relative;
    padding-left: 35px; /* 增加左边距 */
    margin: 15px;
    cursor: pointer;
    user-select: none;
    font-size: 16px;
    margin-top: auto;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: -2px;
    left: 0;
    height: 24px; /* 增大尺寸 */
    width: 24px; /* 增大尺寸 */
    background-color: #ffffff;
    border: 2px solid #0071e3;
    border-radius: 6px; /* 更圆润的边角 */
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.checkbox-container:hover input ~ .checkmark {
    background-color: rgba(0,113,227,0.1);
    transform: scale(1.05);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: #0071e3;
    border-color: #0071e3;
    transform: scale(1);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 8px; /* 调整勾选标记位置 */
    top: 4px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

/* 优化按钮样式 */
.download-btn, .download-single-btn {
    background: linear-gradient(180deg, #0071e3 0%, #0058b0 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,113,227,0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.download-btn:hover, .download-single-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,113,227,0.4);
    background: linear-gradient(180deg, #0077ED 0%, #0062c4 100%);
}

.download-btn:active, .download-single-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,113,227,0.2);
}

.download-single-btn {
    padding: 8px 16px;
    font-size: 14px;
    margin-top: 12px;
}

.reset-btn {
    background: linear-gradient(180deg, #f5f5f7 0%, #e5e5e7 100%);
    color: #1d1d1f;
    border: 1px solid rgba(0,0,0,0.1);
    padding: 12px 24px;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-left: 12px;
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    background: linear-gradient(180deg, #ffffff 0%, #f5f5f7 100%);
}

.reset-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 选择框容器样式优化 */
.select-all-label {
    margin-right: 20px;
    display: inline-flex;
    align-items: center;
}

.select-all-label span:last-child {
    margin-left: 8px;
    font-size: 15px;
    color: #1d1d1f;
}

/* 下载区域样式优化 */
.download-area {
    margin-top: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

/* 语言切换按钮样式 */
.language-switch {
    position: fixed;
    top: 30px;
    right: 30px;
    display: flex;
    gap: 12px;
    z-index: 1000;
    padding: 6px;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.lang-btn {
    background: transparent;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #666;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 6px;
}

.lang-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 113, 227, 0.1);
    border-radius: 25px;
    opacity: 0;
    transition: all 0.3s ease;
}

.lang-btn:hover:before {
    opacity: 1;
}

.lang-btn:hover {
    transform: translateY(-1px);
    color: #0071e3;
}

.lang-btn.active {
    background: #0071e3;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 113, 227, 0.3);
}

.lang-btn.active:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.4);
}

/* 添加语言图标 */
.lang-btn:before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 6px;
    background-size: contain;
    background-repeat: no-repeat;
    vertical-align: middle;
}

.lang-btn[data-lang="zh-CN"]:before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='16' height='16'%3E%3Ctext x='50%25' y='50%25' font-size='14' fill='currentColor' text-anchor='middle' dominant-baseline='middle'%3E中%3C/text%3E%3C/svg%3E");
}

.lang-btn[data-lang="en"]:before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='16' height='16'%3E%3Ctext x='50%25' y='50%25' font-size='14' fill='currentColor' text-anchor='middle' dominant-baseline='middle'%3EEn%3C/text%3E%3C/svg%3E");
}

/* 添加动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.language-switch {
    animation: fadeIn 0.3s ease-out;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .language-switch {
        top: 20px;
        right: 20px;
    }
    
    .lang-btn {
        padding: 8px 16px;
        font-size: 14px;
    }
}